//
//  UIScrollView+SEGSWindmill.h
//  RefreshDemo
//
//  Created by Clavis on 2019/1/2.
//  Copyright © 2019 Clavis. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "SEGWindmillRefreshCommonHeader.h"
#import "SEGWindmillRefreshCommonFooter.h"

NS_ASSUME_NONNULL_BEGIN

@interface UIScrollView (SEGSWindmill)

@property (nonatomic, strong, nullable) SEGWindmillRefreshCommonHeader *seg_header;
@property (nonatomic, strong, nullable) SEGWindmillRefreshCommonFooter *seg_footer;
@property (nonatomic, assign) NSInteger seg_totalDataCount;

// 兼容之前的API
-(void)addWindmillInSuperView:(UIView *)superView;//在viewDidLoad或viewDidAppare中调用此方法,放在父view加tableview之前, 会同时添加上拉和下拉
-(void)draggingScrollViewInOffsety:(CGFloat)offsety;//将此方法放在scrollViewDidScroll:中
-(void)startAnimatingWindmill:(void(^)(BOOL canHeaderFresh, BOOL isFooter))canfreshBlock;//canHeaderFresh是否需要刷新数据和界面
-(void)justShowHeader;//只显示头部,会删除上拉加载视图,在addWindmillInSuperView后调用
-(void)justShowfooter;//只显示底部,会删除下拉刷新视图,在addWindmillInSuperView后调用
-(void)justStartAnimatingWindmill;//一般用于第一次加载时，内部已处理

// 新增API
- (void)addWindmillWithHeaderRefreshBlock:(SEGWindmillComponentRefreshBeginBlock)headerRefreshBlock;
- (void)addWindmillWithFooterRefreshBlock:(SEGWindmillComponentRefreshBeginBlock)footerRefreshBlock;
- (void)addWindmillWithHeaderRefreshBlock:(SEGWindmillComponentRefreshBeginBlock)headerRefreshBlock footerRefreshBlock:(SEGWindmillComponentRefreshBeginBlock)footerRefreshBlock;
- (void)startHeaderAnimatingWindmill;
- (void)startFooterAnimatingWindmill;
- (void)stopAnimatingWindmill;
- (void)stopHeaderAnimatingWindmill;
- (void)stopFooterAnimatingWindmill;

@end

NS_ASSUME_NONNULL_END
